<!DOCTYPE HTML>
<html>
<head>
<title>Your Cart</title>
<link rel="stylesheet" href={{url_for('static', filename='css/cart.css')}} />
<link rel="stylesheet" href={{url_for('static', filename='css/topStyle.css') }} />
</head>
<body>
<div id="title">
	<a href="/">
	<img id="logo" src= {{ url_for('static', filename='images/logo.png') }} />
	</a>
	<form>
		<input id="searchBox" type="text" name="searchQuery">
		<input id="searchButton" type="submit" value="Search">
	</form>

	{% if not loggedIn %}
		<div id="signInButton">
			<a class="link" href="/loginForm">Sign In</a>
		</div>
	{% else %}
	<div class="dropdown">
		<button class="dropbtn">Hello, <br>{{firstName}}</button>
		<div class="dropdown-content">
			<a href="/account/orders">Your orders</a>
			<a href="/account/profile">Your profile</a>
			<hr>
			<a href="/logout">Sign Out</a>
		</div>
	</div>
	{% endif %}
	<div id="kart">
		<a class="link" href="/cart">
		<img src={{url_for('static', filename='images/shoppingCart.png')}} id="cartIcon" />
		CART {{noOfItems}}
		</a>
	</div>
</div>
<div id="cartItems">
	<h2>Shopping Cart</h2>
	<div id="tableItems">
		{% for row in products %}
		<div>
			<hr id="seperator">
			<div id="itemImage">
				<img src={{url_for('static', filename='uploads/'+row[3])}} id="image"/>
			</div>
			<div id="itemName">
				<span id="itemNameTag">{{row[1]}}</span><br>
				In stock<br>
				<a href="/removeFromCart?productId={{row[0]}}">Remove</a>
			</div>
			<div id="itemPrice">
				${{row[2]}}
			</div>
		</div>
		{% endfor %}
		<hr id="seperator">
		<div id="total">
			<span id="subtotal">Subtotal</span> : ${{totalPrice}}
		</div>
	</div>
</div>
<a href="/checkout">Proceed to checkout</a>
</body>
</html>

